﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Data;
using System.Data.OleDb;

namespace Web_HengliSeed.BLL
{
    public class Information
    {
        public static OleDbDataReader GetInformation(string type, string lan)
        {
            try
            {
                string strSql = string.Format(" SELECT * FROM T_Information where T_Type='{0}' and T_Language='{1}' ", type, lan);
                return ClassFile.AccessHelper.ExecuteReader(ClassFile.AccessHelper.ConnectionString, strSql);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static bool UpdateInformation(string type, string lan, string content)
        {
            string strSql = string.Format(" update T_Information set T_Content='{0}' where T_Type='{1}' and T_Language='{2}' ", content, type, lan);
            return (ClassFile.AccessHelper.ExecuteNonQuery(ClassFile.AccessHelper.ConnectionString, strSql, null) > 0) ? true : false;
        }
    }
}